﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class TourTypeController
    {
        public int InsertTourType(TourTypeInfo info)
        {
            return SQL.InsertTourType(info.TourTypeName, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void UpdateTourType(TourTypeInfo info)
        {
            SQL.UpdateTourType(info.TourTypeId, info.TourTypeName, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void DeleteTourType(TourTypeInfo info)
        {
            DeleteTourType(info.TourTypeId);
        }
        public void DeleteTourType(int tourTypeId)
        {
            SQL.DeleteTourType(tourTypeId);
        }
        public TourTypeInfo GetTourType(int tourTypeId)
        {
            return CBO.FillObject<TourTypeInfo>(SQL.GetTourType(tourTypeId));
        }
        public List<TourTypeInfo> ListTourType()
        {
            return CBO.FillCollection<TourTypeInfo>(SQL.ListTourType());
        }
        public DataTable SelectTourType()
        {
            return CBO.ConvertToDataTable(ListTourType(), typeof(TourTypeInfo));
        }
        public Dictionary<object, object> ListTourTypeLookup()
        {
            var users = ListTourType();
            var dicusers = new Dictionary<object, object>();

            foreach (TourTypeInfo info in users)
            {
                dicusers.Add(info.TourTypeId, info.TourTypeName);

            }
            return dicusers;
        }
    }
}
